package com.bestow.basic.service.impl;

import java.util.List;
import com.bestow.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bestow.basic.mapper.FndDistrictMapper;
import com.bestow.basic.domain.FndDistrict;
import com.bestow.basic.service.IFndDistrictService;

/**
 * 区Service业务层处理
 * 
 * @author liliu
 * @date 2022-09-06
 */
@Service
public class FndDistrictServiceImpl implements IFndDistrictService 
{
    @Autowired
    private FndDistrictMapper fndDistrictMapper;

    /**
     * 查询区
     * 
     * @param district 区主键
     * @return 区
     */
    @Override
    public FndDistrict selectFndDistrictByDistrict(String district)
    {
        return fndDistrictMapper.selectFndDistrictByDistrict(district);
    }

    /**
     * 查询区列表
     * 
     * @param fndDistrict 区
     * @return 区
     */
    @Override
    public List<FndDistrict> selectFndDistrictList(FndDistrict fndDistrict)
    {
        return fndDistrictMapper.selectFndDistrictList(fndDistrict);
    }

    /**
     * 新增区
     * 
     * @param fndDistrict 区
     * @return 结果
     */
    @Override
    public int insertFndDistrict(FndDistrict fndDistrict)
    {
        fndDistrict.setCreateTime(DateUtils.getNowDate());
        return fndDistrictMapper.insertFndDistrict(fndDistrict);
    }

    /**
     * 修改区
     * 
     * @param fndDistrict 区
     * @return 结果
     */
    @Override
    public int updateFndDistrict(FndDistrict fndDistrict)
    {
        fndDistrict.setUpdateTime(DateUtils.getNowDate());
        return fndDistrictMapper.updateFndDistrict(fndDistrict);
    }

    /**
     * 批量删除区
     * 
     * @param districts 需要删除的区主键
     * @return 结果
     */
    @Override
    public int deleteFndDistrictByDistricts(String[] districts)
    {
        return fndDistrictMapper.deleteFndDistrictByDistricts(districts);
    }

    /**
     * 删除区信息
     * 
     * @param district 区主键
     * @return 结果
     */
    @Override
    public int deleteFndDistrictByDistrict(String district)
    {
        return fndDistrictMapper.deleteFndDistrictByDistrict(district);
    }
}
